import 'package:flutter/material.dart';
import 'package:flutter_menu/app_config.dart';
import 'package:flutter_menu/data/base_provider.dart';
import 'package:flutter_menu/data/provider/product_provider.dart';
import 'package:flutter_menu/data/provider/shop_provider.dart';
import 'package:flutter_menu/model/category_model.dart';
import 'package:flutter_menu/model/menu_model.dart';
import 'package:flutter_menu/objectbox.g.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';

class CategoryProvider extends BaseProvider<CustomMenuModel> {
  CategoryProvider(super.store);

  /// 分类来源
  /// 0. 过滤electronicMenuModel列表中productList属性中包含imageUrl图片名称不为空的electronicMenuModel
  /// 1. 通过0中拿到的electronicMenuModel的customMenuUuid去匹配CustomMenuModel中的uuid，拿到过滤后的CustomMenuModel的列表

  /// productList展示
  /// 1. 拿到过滤后的CustomMenuModel的列表, 展开列表中CustomMenuListCategoryList， 然后再展开productList，、
  /// （另外第一步CustomMenuModel展开CustomMenuListCategoryList中如果有categoryName重复的，要做合并操作，取俩者productList的并集，如果合并时product的productUuid一样，同样要合并product下的dishList）
  /// 2. 然后productList要根据electronicMenuModel中匹配的customMenuUuid中的productList里面的imageUrl，hotZone, 还要过滤掉其中imageUrl为空的product
  /// 3. 最后展示productList列表

  /// 对第一层自定义菜单做过滤：
  /// 1 电子菜单中整个菜单中未设置图片的
  /// 2 根据房台过滤,房台是绑定在菜单一级的
  List<CustomMenuModel> getCustomMenuList(
      {required List<String> electronicConfigList, String? filterTable}) {
    var allMenus = box
        .query(CustomMenuModel_.uuid.oneOf(electronicConfigList))
        .build()
        .find();

    // 筛选匹配的菜单
    bool fetchFilterTag(String? filterTable, CustomMenuModel menu) {
      //菜单状态
      if (menu.menuStatus != 1) return false;
      return (filterTable == null || filterTable.isEmpty)
          ? menu.tableList != null && menu.tableList!.isNotEmpty
          : menu.tableList?.contains(filterTable) == true;
    }

    final List<CustomMenuModel> allCustomMenu =
        allMenus.where((menu) => fetchFilterTag(filterTable, menu)).toList();

    debugPrint("allCustomMenu ${allCustomMenu.length}");

    return allCustomMenu;
  }

  /// 对第二层自定义分类做过滤：
  /// 1 同名的同类合并
  /// 2 根据分类的供应时间过滤
  List<CustomMenuListCategoryList> getCategoryList(
      {required List<CustomMenuModel> customMenuList}) {
    final List<CustomMenuListCategoryList> allCategories =
        customMenuList.expand((menu) {
      return menu.categoryList.where((category) {
        var supplyTime = category.supplyTime;
        ShopProvider shopProvider = Get.find<ShopProvider>();
        return shopProvider.checkSupplyTimeIsValid(supplyTime);
      }).toList();
    }).toList();

    debugPrint("getCategoryList ${allCategories.length} $allCategories");

    final seenNames = <String>{}; // 使用 Set 存储已见过的分类名称
    return allCategories.where((category) {
      final name = category.categoryName ?? "";
      if (seenNames.contains(name)) {
        return false; // 如果名称已见过，过滤掉
      } else {
        seenNames.add(name);
        return category.productList.isNotEmpty;
      }
    }).toList();
  }

  /// 电子菜单中设置的图片
  Map<String, Map<String, dynamic>> productImageLookup = {};

  void buildProductImageLookupMap(List<ElectronicMenuModel> electronicMenus) {
    if (productImageLookup.isEmpty) {
      for (var electronicMenu in electronicMenus) {
        final customMenuUuid = electronicMenu.customMenuUuid ?? "";

        if (!productImageLookup.containsKey(customMenuUuid)) {
          productImageLookup[customMenuUuid] = {};
        }

        for (var eProduct in electronicMenu.productList) {
          if (eProduct.imageUrl?.isNotEmpty ?? false) {
            productImageLookup[customMenuUuid]![eProduct.productUuid ?? ""] = {
              "imageUrl": eProduct.imageUrl,
              "imageName": eProduct.imageName,
              "hotZone": eProduct.hotZone,
              "isRead": electronicMenu.isRead,
            };
          }
        }
      }
    }
  }

  ///从新梳理下prepareProductList方法，
  /// 第一步，先对CustomMenus加一个过滤方法，1 过滤的原则就是通过electronicMenus 匹配的customMenuUuid和productUuid去过滤掉product.imageUrl为空的product; 2 查找productList表中的规格数据，如果规格都停售，也过滤掉对应的product
  /// 第二步，拿到过滤后的customMenus， customMenus展开CustomMenuListCategoryList中如果有categoryName重复的，要做合并操作，取俩者productList的并集，如果合并时product的productUuid一样，同样要合并product下的dishList
  /// 展示上一部拿到的productList，但是希望productList中关联上第一步中的imageUrl和热区以及isRead参数
  List<CategoryListProductList> prepareProductList(
      {required List<CustomMenuModel> allCustomMenus,
      required List<ElectronicMenuModel> electronicMenus,
      String? filterCategoryName}) {
    // 构建快速查找映射表：customMenuUuid -> productUuid -> imageUrl
    buildProductImageLookupMap(electronicMenus);

    List<CustomMenuModel> filterCustomMenus = [];
    // 第0步：如果filterCategoryName不为空时，过滤 CustomMenus中匹配的分类名
    if (filterCategoryName?.isNotEmpty ?? false) {
      filterCustomMenus =
          filterCustomMenusByCategoryName(allCustomMenus, filterCategoryName!);
    } else {
      filterCustomMenus = allCustomMenus;
    }

    // 第一步：过滤 CustomMenus
    filterCustomMenusWithImageAndSpecStatus(
        filterCustomMenus, productImageLookup);

    // 第二步：展开并合并分类
    final Map<String, List<CategoryListProductList>> mergedCategories = {};

    for (var customMenu in filterCustomMenus) {
      for (var category in customMenu.categoryList) {
        final categoryName = category.categoryName ?? "";

        //根据分类的供应时间过滤
        var isSupplyTimeValid = Get.find<ShopProvider>()
            .checkSupplyTimeIsValid(category.supplyTime);

        if (isSupplyTimeValid) {
          if (mergedCategories.containsKey(categoryName)) {
            final existingProducts = mergedCategories[categoryName]!;
            debugPrint("_mergeCategoryLists ${categoryName} $existingProducts");
            mergedCategories[categoryName] = _mergeProductLists(
                existingProducts, category.productList.toList());
          } else {
            mergedCategories[categoryName] = category.productList.toList();
          }
        }
      }
    }

    debugPrint("allCategory ${mergedCategories.length} ${mergedCategories}");

    // 第三步：关联 imageUrl
    final allProducts = <CategoryListProductList>[];
    for (var categoryName in mergedCategories.keys) {
      final productList = mergedCategories[categoryName]!;

      for (var product in productList) {
        final customMenuUuid = filterCustomMenus
            .firstWhereOrNull((menu) => menu.categoryList
                .any((cat) => cat.productList.contains(product)))
            ?.uuid;

        final productWithImage = productImageLookup[customMenuUuid ?? ""]
            ?[product.productUuid ?? ""];

        if (productWithImage != null) {
          product.imageUrl = productWithImage["imageUrl"];
          product.imageName = productWithImage["imageName"];
          product.hotZone = productWithImage["hotZone"];
          product.isRead = productWithImage["isRead"];
          debugPrint("product with image ${product}");
          allProducts.add(product);
        }
      }
    }

    return allProducts;
  }

  List<CustomMenuModel> filterCustomMenusByCategoryName(
      List<CustomMenuModel> menus, String categoryName) {
    return menus
        .map((menu) {
          // 筛选 categoryList 中符合条件的分类
          final filteredCategories = menu.categoryList
              .where((category) => category.categoryName == categoryName)
              .toList();

          // 如果有匹配的分类，保留 CustomMenuModel，更新其 categoryList
          if (filteredCategories.isNotEmpty) {
            return CustomMenuModel(
              obxId: menu.obxId,
              uuid: menu.uuid,
              menuName: menu.menuName,
              menuScene: menu.menuScene,
              menuStatus: menu.menuStatus,
              menuType: menu.menuType,
              tableList: menu.tableList,
            )..categoryList = ToMany(items: filteredCategories);
          }
          return null; // 如果没有匹配，返回 null
        })
        .whereType<CustomMenuModel>() // 过滤掉 null 值
        .toList();
  }

  /// 通过electronicMenus 匹配的customMenuUuid和productUuid去过滤掉product.imageUrl为空的product
  filterCustomMenusWithImageAndSpecStatus(List<CustomMenuModel> allCustomMenus,
      Map<String, Map<String, dynamic>> productImageLookup) {
    for (var customMenu in allCustomMenus) {
      final customMenuUuid = customMenu.uuid ?? "";

      for (var category in customMenu.categoryList) {
        category.productList = ToMany(
          items: category.productList.where((product) {
            // 1 过滤 category 的 productList，保留 imageUrl 不为空的产品
            final imageUrl = productImageLookup[customMenuUuid]
                ?[product.productUuid ?? ""]?["imageUrl"];

            //2 查找productList表中的规格数据，过滤条件：1 规格都停售，2 sku list中找不到uuid
            ProductProvider productProvider = Get.find<ProductProvider>();
            var areAllSpecsStopped = productProvider.areAllSpecsStopped(
                product.productUuid ?? "",
                product.dishList
                    .map((item) => item.productSpecsUuid)
                    .whereType<String>()
                    .toList());

            return (imageUrl?.isNotEmpty ?? false) && !areAllSpecsStopped;
          }).toList(),
        );
      }
    }
    debugPrint(
        "filterCustomMenusWithProductImageSetting ${allCustomMenus.length} ${allCustomMenus}");
  }

  /// 合并两个 productList，按 productUuid 去重并合并 dishList
  List<CategoryListProductList> _mergeProductLists(
      List<CategoryListProductList> list1,
      List<CategoryListProductList> list2) {
    final Map<String, CategoryListProductList> mergedMap = {};

    for (var product in [...list1, ...list2]) {
      if (mergedMap.containsKey(product.productUuid)) {
        // 合并 dishList
        final existingProduct = mergedMap[product.productUuid]!;
        debugPrint(
            "_mergeProductLists ${product.productUuid} $existingProduct");
        existingProduct.dishList = ToMany(
            items: _mergeDishLists(
                existingProduct.dishList.toList(), product.dishList.toList()));
      } else {
        mergedMap[product.productUuid ?? ""] = product;
      }
    }

    return mergedMap.values.toList();
  }

  /// 合并两个 dishList，按 dishUuid 去重，取 customPrice 高的
  List<DishList> _mergeDishLists(List<DishList> list1, List<DishList> list2) {
    final Map<String, DishList> mergedMap = {};

    for (var dish in [...list1, ...list2]) {
      final dishUuid = dish.productSpecsUuid ?? "";

      if (mergedMap.containsKey(dishUuid)) {
        // 如果已存在，取 customPrice 高的
        final existingDish = mergedMap[dishUuid]!;
        debugPrint(
            "_mergeDishLists $dishUuid ${existingDish.customPrice} ${dish.customPrice}");
        if ((dish.customPrice ?? 0) > (existingDish.customPrice ?? 0)) {
          mergedMap[dishUuid] = dish;
        }
      } else {
        // 不存在，直接加入
        mergedMap[dishUuid] = dish;
      }
    }

    return mergedMap.values.toList();
  }

  /// 通过productUuid来获取用户选择的自定义菜单列表
  List<CustomMenuModel> getCategoryListWithProductId(
      String? productUuid,
      {required List<CustomMenuModel> customMenuList}) {

    List<CustomMenuModel> filteredMenus = [];
    // 遍历所有菜单
    for (var menu in customMenuList) {
      bool menuContainsProduct = false;

      // 遍历菜单中的每个分类
      for (var category in menu.categoryList) {
        // 在分类中的菜品列表中查找是否有匹配的 productUuid
        for (var product in category.productList) {
          if (product.productUuid == productUuid) {
            menuContainsProduct = true;
            break; // 找到匹配的菜品，跳出循环
          }
        }

        if (menuContainsProduct) {
          break; // 如果该菜单包含匹配的菜品，跳出分类遍历
        }
      }

      // 如果菜单包含该菜品，则加入过滤后的列表
      if (menuContainsProduct) {
        filteredMenus.add(menu);
      }
    }

    return filteredMenus;
  }

  void putDemoData() {
    if (box.isEmpty()) {
      clear();
      insertManyFromJson().then((value) {
        debugPrint("insertManyCategoryFromJson $value");
      }, onError: (err) {
        debugPrint("insertManyCategoryFromJson error $err");
      });
    }
  }

  // 批量插入 JSON 列表
  Future<List<int>> insertManyFromJson() {
    List<dynamic> demoJson = [
      {
        "uuid": "B1FAAA4F10",
        "menuType": 1,
        "menuName": "Pesanan POS",
        "menuScene": 1,
        "menuStatus": 1,
        "tableList": ["23232323test"],
        "categoryList": [
          {
            "uuid": "8045A40A9A",
            "categoryName": "中餐",
            "secondName": null,
            "sort": 1,
            "productList": [],
            "supplyTime": [
              {
                "marketTypeCode": "0",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "1",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "2",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "3",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              }
            ]
          },
          {
            "uuid": "18996BAF96",
            "categoryName": "主食",
            "secondName": null,
            "sort": 2,
            "productList": [
              {
                "productUuid": "833006101edc4b18b61e55224912ba4a",
                "sort": 1,
                "dishList": [
                  {
                    "uuid": "DD86F1970D",
                    "productSpecsUuid": "95ec686a43884f88a46e33c91fe754c1",
                    "customPrice": 13434,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 1
                  },
                  {
                    "uuid": "4B488E3695",
                    "productSpecsUuid": "cfe636f053dc46bca76aade95fe79190",
                    "customPrice": 343434,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 2
                  }
                ],
                "productType": 0
              }
            ],
            "supplyTime": [
              {
                "marketTypeCode": "0",
                "marketTypeName": null,
                "days": [1, 2, 3, 5, 4, 6, 7]
              }
            ]
          },
          {
            "uuid": "D1C0199B09",
            "categoryName": "饮料",
            "secondName": null,
            "sort": 3,
            "productList": [
              {
                "productUuid": "0c297b8d400b409690f04da551314b68",
                "sort": 1,
                "dishList": [
                  {
                    "uuid": "EE4FF14454",
                    "productSpecsUuid": "177b4524a71243a6b1ec0a291a5b1aff",
                    "customPrice": 60,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 1
                  },
                  {
                    "uuid": "14C7DDFE44",
                    "productSpecsUuid": "a698ca6e6cc5446f91a1a057c96d3c81",
                    "customPrice": 100,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 2
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "1c4996ff4b7d4806af48119fb48323b8",
                "sort": 1,
                "dishList": [
                  {
                    "uuid": "EE4FF14454",
                    "productSpecsUuid": "177b4524a71243a6b1ec0a291a5b1aff",
                    "customPrice": 160,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 1
                  },
                ],
                "productType": 1
              },
              {
                "productUuid": "9e7181978608411384c3ea5f8b8d0561",
                "sort": 1,
                "dishList": [
                  {
                    "uuid": "EE4FF14454",
                    "productSpecsUuid": "9e7181978608411384c3ea5f8b8d0561",
                    "customPrice": 1260,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 1
                  },
                ],
                "productType": 1
              }
            ],
            "supplyTime": [
              {
                "marketTypeCode": "0",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "1",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "2",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "3",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              }
            ]
          },
          {
            "uuid": "7B8FD33F57",
            "categoryName": "单规格菜品分类",
            "secondName": null,
            "sort": 4,
            "productList": [
              {
                "productUuid": "30fd4f4fc6d6465c84247faef9b442b6",
                "sort": 1,
                "dishList": [
                  {
                    "uuid": "8E1F4490ED",
                    "productSpecsUuid": "f2f26da0d37a498bb4bc0aad98eaea52",
                    "customPrice": 9500,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 1
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "b68e4bd926b44720a174cd3f3fefb7a8",
                "sort": 2,
                "dishList": [
                  {
                    "uuid": "30EE0A4D5D",
                    "productSpecsUuid": "c2e84de7107146e6a4cb6ba9453552ff",
                    "customPrice": 900,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 2
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "687ae576db644096bb8c4b9cc7f0ffa9",
                "sort": 3,
                "dishList": [
                  {
                    "uuid": "068FEA8804",
                    "productSpecsUuid": "6de0583286b8403cbb1a8c8b99d9b06b",
                    "customPrice": 35,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 3
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "3d10f37a342f4933958c09fd03093da0",
                "sort": 4,
                "dishList": [
                  {
                    "uuid": "990D94B3EF",
                    "productSpecsUuid": "8c3c6488b6c94b1c8795dd80c7e1817b",
                    "customPrice": 25,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 4
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "7ec0039e9daf45a3981dcb48e30cfe61",
                "sort": 5,
                "dishList": [
                  {
                    "uuid": "5A5FC62E65",
                    "productSpecsUuid": "667969d7ca2e41f39415c93c9452142d",
                    "customPrice": 25,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 5
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "c7ccccd03f6f4ef4b9c4be4e1b1a6f0c",
                "sort": 6,
                "dishList": [
                  {
                    "uuid": "237BF03230",
                    "productSpecsUuid": "0232e6bac307452ea73c2bc6129bae49",
                    "customPrice": 35,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 6
                  }
                ],
                "productType": 0
              }
            ],
            "supplyTime": [
              {
                "marketTypeCode": "0",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "1",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "2",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "3",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              }
            ]
          },
          {
            "uuid": "054884A535",
            "categoryName": "ID",
            "secondName": null,
            "sort": 5,
            "productList": [
              {
                "productUuid": "44ab16402bb2407cab8907f499d1ac0d",
                "sort": 1,
                "dishList": [
                  {
                    "uuid": "4B4ADFFFBB",
                    "productSpecsUuid": "ff5f1161dc1e412099cd4fc167169379",
                    "customPrice": 15000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 1
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "16a75df5dfec42e6b692bbb6b876ea27",
                "sort": 2,
                "dishList": [
                  {
                    "uuid": "748947A175",
                    "productSpecsUuid": "f87e587e6a36453aa4ad690467d4b410",
                    "customPrice": 13000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 2
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "7faab61c6d6a45a5b82fffbf49dc4978",
                "sort": 3,
                "dishList": [
                  {
                    "uuid": "718D5D8D14",
                    "productSpecsUuid": "c1b76853326f4b1b8db7996c883321de",
                    "customPrice": 18000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 3
                  },
                  {
                    "uuid": "4B683F2C48",
                    "productSpecsUuid": "692ee4b1e8db43ceb7a951e22113ec24",
                    "customPrice": 20000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 4
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "a94a448f74e147a291fa24390d105d89",
                "sort": 5,
                "dishList": [
                  {
                    "uuid": "6313421819",
                    "productSpecsUuid": "71b38f66bcbd4862bf4e4b866a170853",
                    "customPrice": 16000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 5
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "aa14bc47ffd94c53b7b825e952eb62a7",
                "sort": 6,
                "dishList": [
                  {
                    "uuid": "5B84E630F8",
                    "productSpecsUuid": "d4a5deb2963a4bc098d5c5a94adb661a",
                    "customPrice": 10000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 6
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "99249712af234efaaf27d394a480a757",
                "sort": 7,
                "dishList": [
                  {
                    "uuid": "0AB133B310",
                    "productSpecsUuid": "706cd8e1b5de421c80334c0e4b4fa8ef",
                    "customPrice": 17000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 7
                  },
                  {
                    "uuid": "8A7BEBE958",
                    "productSpecsUuid": "7c2a226d23ef43d998f953f2b5c4fc18",
                    "customPrice": 17000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 8
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "66ecea2aac5b4608ae7d4177f5299b7a",
                "sort": 9,
                "dishList": [
                  {
                    "uuid": "DAEB02E3C4",
                    "productSpecsUuid": "6815c88b5482470b8fa16ee6da84a8a6",
                    "customPrice": 16000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 9
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "356a2ae2b5ca4b68b6ace5089bba7b9a",
                "sort": 10,
                "dishList": [
                  {
                    "uuid": "A9A681D424",
                    "productSpecsUuid": "1edff9efc8f043668207905b9a8771c0",
                    "customPrice": 12000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 10
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "3f2ee2b43cad41c595b458ff4d494db1",
                "sort": 11,
                "dishList": [
                  {
                    "uuid": "F136DF399F",
                    "productSpecsUuid": "e72c17c65f5b47dfac265dbbb09de8c7",
                    "customPrice": 12000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 11
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "e0c73dfbabe14a49afc4c3f6051576fa",
                "sort": 12,
                "dishList": [
                  {
                    "uuid": "12773D11D7",
                    "productSpecsUuid": "d678340176d34d35b1c4f26099e97ecd",
                    "customPrice": 20000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 12
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "341cfeb290a742029bd6973617ac9a43",
                "sort": 13,
                "dishList": [
                  {
                    "uuid": "17887A8C97",
                    "productSpecsUuid": "028a939b70064a6e874aae0e34f84c38",
                    "customPrice": 12000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 13
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "1c7af177da9140b5b17cb22b7de52cbc",
                "sort": 14,
                "dishList": [
                  {
                    "uuid": "41E884496E",
                    "productSpecsUuid": "89398e44ee6d484eb657ecafc7db8f12",
                    "customPrice": 15000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 14
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "307905b2c5a24c00be43ddfddf4abc2f",
                "sort": 15,
                "dishList": [
                  {
                    "uuid": "2F082B4FF8",
                    "productSpecsUuid": "1e33f6dd106c4b8baf37b97431368cf2",
                    "customPrice": 14000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 15
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "433f4584f1ed4f3d81ac5af12f2876d0",
                "sort": 16,
                "dishList": [
                  {
                    "uuid": "0565461DFF",
                    "productSpecsUuid": "89ee18bdf77142c7a159b2d32ff07123",
                    "customPrice": 15000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 16
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "0b540fbe4da548ef835c9d9b8a20a4d8",
                "sort": 17,
                "dishList": [
                  {
                    "uuid": "C0991DACA6",
                    "productSpecsUuid": "ea43ff04dda44ac6914e2be3dd6bcd6b",
                    "customPrice": 14000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 17
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "193b1189dbd3474185c42a8eda0d8efc",
                "sort": 18,
                "dishList": [
                  {
                    "uuid": "0FD225FC84",
                    "productSpecsUuid": "46a5e883f8c04857827b44ffa6fc7467",
                    "customPrice": 14000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 18
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "0c74174c3d014751b25f1b04ac845af1",
                "sort": 19,
                "dishList": [
                  {
                    "uuid": "779A939864",
                    "productSpecsUuid": "c46faad0a1ff416d9758d9f8108eaab9",
                    "customPrice": 22000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 19
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "a0e0346302c94fecb926b1f583530fb0",
                "sort": 20,
                "dishList": [
                  {
                    "uuid": "F7E99839FA",
                    "productSpecsUuid": "1d1eecaabec7427f825a84ed4c7e23fe",
                    "customPrice": 18000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 20
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "7c35a750deb948c1993aa25344c9ed1d",
                "sort": 21,
                "dishList": [
                  {
                    "uuid": "4545A65868",
                    "productSpecsUuid": "3294bb436995408789fc40666a7c6c2d",
                    "customPrice": 18000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 21
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "f340485532464f9f80bc977006abc16f",
                "sort": 22,
                "dishList": [
                  {
                    "uuid": "0938BA485A",
                    "productSpecsUuid": "ae1287ab0d1843b3ac4a4e732a3aa5bb",
                    "customPrice": 3000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 22
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "4c24609010444ab7a4cf017f4d021cb7",
                "sort": 23,
                "dishList": [
                  {
                    "uuid": "A9090703A3",
                    "productSpecsUuid": "b3d04b06df10428381488ee6b6ea8c1d",
                    "customPrice": 10000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 23
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "593b7e28c50646c99d191280985c52a0",
                "sort": 24,
                "dishList": [
                  {
                    "uuid": "4258B156CB",
                    "productSpecsUuid": "a45bf260eeaa458aaca7908c1cd09a3c",
                    "customPrice": 18000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 24
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "9fda88ae9ed343d9a0a5cea759007d22",
                "sort": 25,
                "dishList": [
                  {
                    "uuid": "4988F9A3B9",
                    "productSpecsUuid": "f75472f5545e4fe587689ebfe8c53f74",
                    "customPrice": 22000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 25
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "1c4b9e9e94bb4b40acbad7ec217c7d80",
                "sort": 26,
                "dishList": [
                  {
                    "uuid": "2C28C0F014",
                    "productSpecsUuid": "1e5558ed4066466cb56501c7f20934f2",
                    "customPrice": 20000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 26
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "aa817e0c7d61438181e4267f06548b43",
                "sort": 27,
                "dishList": [
                  {
                    "uuid": "D8AD5E58C4",
                    "productSpecsUuid": "5a4f8f0008cd4c799a7f4c45d814caef",
                    "customPrice": 10000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 27
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "d9a068536f1c4b588ac0e494505b1cf6",
                "sort": 28,
                "dishList": [
                  {
                    "uuid": "1E4E911FED",
                    "productSpecsUuid": "ec207bfb5dda42d585b1c2c017c481a2",
                    "customPrice": 20000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 28
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "c8cf0d634f9546a0af9ab93455a3e6ca",
                "sort": 29,
                "dishList": [
                  {
                    "uuid": "B8DDD40658",
                    "productSpecsUuid": "bcfc1030069b4ae68537fb1ad87160bc",
                    "customPrice": 20000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 29
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "431e9f3e439b43c9a5d49e5c2656250a",
                "sort": 30,
                "dishList": [
                  {
                    "uuid": "3F36D7BBB9",
                    "productSpecsUuid": "cc046d336a6d416da7539fb8765d1db3",
                    "customPrice": 8000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 30
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "cf1e143a92bf4c4891ab17bab98c3bcd",
                "sort": 31,
                "dishList": [
                  {
                    "uuid": "4C423AA9BB",
                    "productSpecsUuid": "16f7fbdf361b40608af25adc9865a31d",
                    "customPrice": 16000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 31
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "15b6c6f4e95b4cbfa029e9baff0e2536",
                "sort": 32,
                "dishList": [
                  {
                    "uuid": "62C6449BBA",
                    "productSpecsUuid": "d30cb4c2fc4247e6a8052b99cff6c0cc",
                    "customPrice": 18000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 32
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "321ea0d6187d4c61be15066ffa0ad3e2",
                "sort": 33,
                "dishList": [
                  {
                    "uuid": "3E44BBB207",
                    "productSpecsUuid": "cb90534e60aa4f5dbc528592529f0c1d",
                    "customPrice": 18000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 33
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "c3761857504c4b159c1b35baf326c47e",
                "sort": 34,
                "dishList": [
                  {
                    "uuid": "649A766A4E",
                    "productSpecsUuid": "2ad5c07fb9624186a43270006a75ff3f",
                    "customPrice": 15000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 34
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "eb363c8ba5904fa79841a9e52efeaf29",
                "sort": 35,
                "dishList": [
                  {
                    "uuid": "2A682AAE6A",
                    "productSpecsUuid": "42e85c2c02424f158a074bfcad2ff566",
                    "customPrice": 17000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 35
                  },
                  {
                    "uuid": "94FD28909C",
                    "productSpecsUuid": "c90c992b13be411a96cc60b87db797aa",
                    "customPrice": 17000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 37
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "134c9858c13d4c8fbf224044093ba9a8",
                "sort": 36,
                "dishList": [
                  {
                    "uuid": "3B54428D16",
                    "productSpecsUuid": "b9bb51b92f6d4af986231e6841030f69",
                    "customPrice": 18000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 36
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "9f5a69ecd9b14bc1a1cf771ca080608d",
                "sort": 38,
                "dishList": [
                  {
                    "uuid": "72D2EDE5BB",
                    "productSpecsUuid": "ee6365a86f8b44b1b551e5186571a951",
                    "customPrice": 14000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 38
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "dde9913b0f81420f90d0cc159287ab34",
                "sort": 39,
                "dishList": [
                  {
                    "uuid": "FD66CDA8A9",
                    "productSpecsUuid": "151051ce10fa41aab24543e28e803882",
                    "customPrice": 16000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 39
                  }
                ],
                "productType": 0
              }
            ],
            "supplyTime": [
              {
                "marketTypeCode": "0",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 6, 7]
              },
              {
                "marketTypeCode": "1",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "2",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "3",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              }
            ]
          }
        ]
      },
      {
        "uuid": "7929437418",
        "menuType": 1,
        "menuName": "Pesanan Scan QR",
        "menuScene": 2,
        "menuStatus": 0,
        "tableList": [],
        "categoryList": []
      },
      {
        "uuid": "71474D543D",
        "menuType": 3,
        "menuName": "Delivery",
        "menuScene": 4,
        "menuStatus": 0,
        "tableList": [],
        "categoryList": []
      },
      {
        "uuid": "CCE48FF665",
        "menuType": 2,
        "menuName": "自定义菜单",
        "menuScene": 3,
        "menuStatus": 1,
        "tableList": [
          "6458D72B44",
          "191E5F399A",
          "98079451F9",
          "366812E872",
          "6158AB3EA9",
          "B87E187762",
          "167F7E147F",
          "B657F7F7A8",
          "68BF85A900",
          "A35B4E7453"
        ],
        "categoryList": [
          {
            "uuid": "18996BAF93",
            "categoryName": "主食不同明分类",
            "secondName": null,
            "sort": 2,
            "productList": [
              {
                "productUuid": "833006101edc4b18b61e55224912ba4b",
                "sort": 1,
                "dishList": [
                  {
                    "uuid": "DD86F1970D",
                    "productSpecsUuid": "95ec686a43884f88a46e33c91fe754c1",
                    "customPrice": 567890,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 1
                  },
                  {
                    "uuid": "4B488E3695",
                    "productSpecsUuid": "cfe636f053dc46bca76aade95fe79190",
                    "customPrice": 167890,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 2
                  }
                ],
                "productType": 0
              }
            ],
            "supplyTime": [
              {
                "marketTypeCode": "0",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "1",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "2",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "3",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              }
            ]
          },
          {
            "uuid": "18996BAF93",
            "categoryName": "主食",
            "secondName": null,
            "sort": 2,
            "productList": [
              {
                "productUuid": "833006101edc4b18b61e55224912ba4a",
                "sort": 1,
                "dishList": [
                  {
                    "uuid": "4B488E3695",
                    "productSpecsUuid": "cfe636f053dc46bca76aade95fe79190",
                    "customPrice": 20,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 2
                  }
                ],
                "productType": 1
              }
            ],
            "supplyTime": [
              {
                "marketTypeCode": "0",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "1",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "2",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "3",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              }
            ]
          },
          {
            "uuid": "7ABC724042",
            "categoryName": "自定义菜单分类1",
            "secondName": null,
            "sort": 1,
            "productList": [
              {
                "productUuid": "b98fa3c5f1c045a8b2e9e9c4c507a999",
                "sort": 1,
                "dishList": [
                  {
                    "uuid": "63D706280E",
                    "productSpecsUuid": "ba24948b72a44e6f965258c7f2a3e237",
                    "customPrice": 993434.3434,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 1
                  },
                  {
                    "uuid": "1BEFBF3417",
                    "productSpecsUuid": "8cd4f9f4eb6d4ca1866d1a4244b0c8ce",
                    "customPrice": 193434.3434,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 2
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "91967015cff7455c87cae251bb56c78b",
                "sort": 3,
                "dishList": [
                  {
                    "uuid": "4B8EC97F98",
                    "productSpecsUuid": "1a4d584429414ff7871d16a512499c2e",
                    "customPrice": 66,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 3
                  },
                  {
                    "uuid": "A9A329C204",
                    "productSpecsUuid": "e52c426489fa47e3bf180d9859f6b53d",
                    "customPrice": 88,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 4
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "2c84820c229941d69485e845d93d25ec",
                "sort": 5,
                "dishList": [
                  {
                    "uuid": "D25355B220",
                    "productSpecsUuid": "bde43fca612944dbbba71c8fc12ed9eb",
                    "customPrice": 1,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 5
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "16a75df5dfec42e6b692bbb6b876ea27",
                "sort": 6,
                "dishList": [
                  {
                    "uuid": "91C44F635B",
                    "productSpecsUuid": "f87e587e6a36453aa4ad690467d4b410",
                    "customPrice": 15000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 6
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "ebcef8d2ae6842c4871685994b20aa63",
                "sort": 7,
                "dishList": [
                  {
                    "uuid": "F42021F1ED",
                    "productSpecsUuid": "8fa2b6c8cd1d465da676b9c97ed5232a",
                    "customPrice": 1000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 7
                  },
                  {
                    "uuid": "7DDD10D77D",
                    "productSpecsUuid": "3d042b2864f4489b8334431ec47f0805",
                    "customPrice": 1000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 8
                  },
                  {
                    "uuid": "FBE7A40405",
                    "productSpecsUuid": "d5829a3c532a4d06890080ea4013be7c",
                    "customPrice": 3000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 9
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "47c5b8445c4348d080c3e41e03c82f7b",
                "sort": 11,
                "dishList": [
                  {
                    "uuid": "29B4CB4B9B",
                    "productSpecsUuid": "22d469f40a0d4438a80dfa4b14dcceb7",
                    "customPrice": 200,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 11
                  },
                  {
                    "uuid": "3CE3E7603D",
                    "productSpecsUuid": "61b0e24b54354da39c99832e5a9b49fe",
                    "customPrice": 300,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 12
                  },
                  {
                    "uuid": "C33261CB72",
                    "productSpecsUuid": "3f04c71b345f4b7096430e0b3ab6b3ed",
                    "customPrice": 400,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 13
                  },
                  {
                    "uuid": "A3A4423EEF",
                    "productSpecsUuid": "7d208b7adcc040c7b6571facfcc223e2",
                    "customPrice": 100,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 14
                  }
                ],
                "productType": 0
              }
            ],
            "supplyTime": [
              {
                "marketTypeCode": "0",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "1",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "2",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "3",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              }
            ]
          }
        ]
      },
      {
        "uuid": "64C54DC474",
        "menuType": 2,
        "menuName": "SVIP专属菜单",
        "menuScene": 3,
        "menuStatus": 1,
        "tableList": [
          "81DF0DF68A",
          "EF01D0D1ED",
          "E7538E69A1",
          "6658E1D62E",
          "BA4B038E16",
          "4F4AA67440",
          "9C39AD203C",
          "9598B4F311"
        ],
        "categoryList": [
          {
            "uuid": "DCAAAAF4BF",
            "categoryName": "SVIP专属菜单1",
            "secondName": null,
            "sort": 1,
            "productList": [
              {
                "productUuid": "0c297b8d400b409690f04da551314b68",
                "sort": 1,
                "dishList": [
                  {
                    "uuid": "FF5E4F4BDF",
                    "productSpecsUuid": "177b4524a71243a6b1ec0a291a5b1aff",
                    "customPrice": 88888,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 1
                  },
                  {
                    "uuid": "7F642F88F4",
                    "productSpecsUuid": "a698ca6e6cc5446f91a1a057c96d3c81",
                    "customPrice": 88888,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 2
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "47c5b8445c4348d080c3e41e03c82f7b",
                "sort": 3,
                "dishList": [
                  {
                    "uuid": "0792CC098C",
                    "productSpecsUuid": "7d208b7adcc040c7b6571facfcc223e2",
                    "customPrice": 88888,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 3
                  },
                  {
                    "uuid": "1AAA952E1E",
                    "productSpecsUuid": "22d469f40a0d4438a80dfa4b14dcceb7",
                    "customPrice": 88888,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 4
                  },
                  {
                    "uuid": "F5C55DFC04",
                    "productSpecsUuid": "61b0e24b54354da39c99832e5a9b49fe",
                    "customPrice": 888,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 5
                  },
                  {
                    "uuid": "88CD50E8AE",
                    "productSpecsUuid": "3f04c71b345f4b7096430e0b3ab6b3ed",
                    "customPrice": 888,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 6
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "cdc156238a4a487dbf9a308b4d02c271",
                "sort": 7,
                "dishList": [
                  {
                    "uuid": "F341F33D1A",
                    "productSpecsUuid": "9b14f46c1ea24f909607b585e054540a",
                    "customPrice": 9999,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 7
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "17b54c3734264412a9edca4af703062e",
                "sort": 8,
                "dishList": [
                  {
                    "uuid": "F566376DE7",
                    "productSpecsUuid": "9d2b6613856142c48d64fd54468184ab",
                    "customPrice": 9999,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 8
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "911d62cbbd4f478bb6d2206b1b7aeb50",
                "sort": 9,
                "dishList": [
                  {
                    "uuid": "43E4D35814",
                    "productSpecsUuid": "0efcb95b8db6423fadf4052bd4a6f1c0",
                    "customPrice": 9999,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 9
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "ce8842b164ba4c9b91f4a68574b76564",
                "sort": 10,
                "dishList": [
                  {
                    "uuid": "8D2040F86B",
                    "productSpecsUuid": "7f2dd018c9c4457583b30eb1281169c8",
                    "customPrice": 9999,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 10
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "a9aa9e91283a42dd82c7d1ca7dddae51",
                "sort": 11,
                "dishList": [
                  {
                    "uuid": "B4754272BA",
                    "productSpecsUuid": "29431b71c9b64ae3beac12c9aea2c014",
                    "customPrice": 9999,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 11
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "33398352b6c949a88bc1381102f11c5e",
                "sort": 12,
                "dishList": [
                  {
                    "uuid": "51C8D1145A",
                    "productSpecsUuid": "2eb5122a982b4499b377ae09d5b589ad",
                    "customPrice": 10000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 12
                  },
                  {
                    "uuid": "E39EFC34B3",
                    "productSpecsUuid": "2040a1fb13cf45b59883995c2d140044",
                    "customPrice": 10000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 13
                  }
                ],
                "productType": 0
              }
            ],
            "supplyTime": [
              {
                "marketTypeCode": "0",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "1",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "2",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "3",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              }
            ]
          }
        ]
      },
      {
        "uuid": "CFE7B8EFCC",
        "menuType": 2,
        "menuName": "扫码下单自定义菜单",
        "menuScene": 2,
        "menuStatus": 1,
        "tableList": [
          "6458D72B44",
          "191E5F399A",
          "98079451F9",
          "366812E872",
          "6158AB3EA9",
          "B87E187762",
          "167F7E147F",
          "B657F7F7A8",
          "68BF85A900",
          "A35B4E7453"
        ],
        "categoryList": [
          {
            "uuid": "4AAFB549A4",
            "categoryName": "扫码下单自定义菜单1",
            "secondName": null,
            "sort": 1,
            "productList": [
              {
                "productUuid": "b98fa3c5f1c045a8b2e9e9c4c507a999",
                "sort": 1,
                "dishList": [
                  {
                    "uuid": "437B426DB1",
                    "productSpecsUuid": "ba24948b72a44e6f965258c7f2a3e237",
                    "customPrice": 99,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 1
                  },
                  {
                    "uuid": "45887B9D18",
                    "productSpecsUuid": "8cd4f9f4eb6d4ca1866d1a4244b0c8ce",
                    "customPrice": 88,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 2
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "91967015cff7455c87cae251bb56c78b",
                "sort": 3,
                "dishList": [
                  {
                    "uuid": "09A4C846A9",
                    "productSpecsUuid": "1a4d584429414ff7871d16a512499c2e",
                    "customPrice": 66,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 3
                  },
                  {
                    "uuid": "7C0B466734",
                    "productSpecsUuid": "e52c426489fa47e3bf180d9859f6b53d",
                    "customPrice": 88,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 4
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "2c84820c229941d69485e845d93d25ec",
                "sort": 5,
                "dishList": [
                  {
                    "uuid": "02CE46BAB1",
                    "productSpecsUuid": "bde43fca612944dbbba71c8fc12ed9eb",
                    "customPrice": 1,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 5
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "99aa8fe3fec44208a52838cf0c56dda6",
                "sort": 6,
                "dishList": [
                  {
                    "uuid": "74CA0A5115",
                    "productSpecsUuid": "a918809f1e49499a9777d14a746e0223",
                    "customPrice": 2,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 6
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "c11b9cd7582d49f4ae70ca63e0b5f67e",
                "sort": 7,
                "dishList": [
                  {
                    "uuid": "458A100453",
                    "productSpecsUuid": "0d55a290d6c94de58e5ab624343b10ee",
                    "customPrice": 70,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 7
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "fc414beadfa4459caa07b86cd18c64d2",
                "sort": 8,
                "dishList": [
                  {
                    "uuid": "2BB2A2EAE9",
                    "productSpecsUuid": "c92ac6f1a03a46dba5df03b252466602",
                    "customPrice": 100,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 8
                  },
                  {
                    "uuid": "555BFE3A0A",
                    "productSpecsUuid": "ef83e8ef8d5d4716b11e681d8e998d48",
                    "customPrice": 200,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 9
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "833006101edc4b18b61e55224912ba4a",
                "sort": 11,
                "dishList": [
                  {
                    "uuid": "9772C92C4D",
                    "productSpecsUuid": "95ec686a43884f88a46e33c91fe754c1",
                    "customPrice": 5,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 11
                  },
                  {
                    "uuid": "BBC9AFA599",
                    "productSpecsUuid": "cfe636f053dc46bca76aade95fe79190",
                    "customPrice": 10,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 12
                  }
                ],
                "productType": 0
              },
              {
                "productUuid": "16a75df5dfec42e6b692bbb6b876ea27",
                "sort": 13,
                "dishList": [
                  {
                    "uuid": "103BD3B0A8",
                    "productSpecsUuid": "f87e587e6a36453aa4ad690467d4b410",
                    "customPrice": 16000,
                    "minAmount": null,
                    "maxAmount": null,
                    "changePrice": null,
                    "memberPrice1": null,
                    "memberPrice2": null,
                    "memberPrice3": null,
                    "sort": 13
                  }
                ],
                "productType": 0
              }
            ],
            "supplyTime": [
              {
                "marketTypeCode": "0",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "1",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "2",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              },
              {
                "marketTypeCode": "3",
                "marketTypeName": null,
                "days": [1, 2, 3, 4, 5, 6, 7]
              }
            ]
          }
        ]
      }
    ];
    // final categories = demoJson.map((json) => CategoryModel.fromJson(json)).toList();
    final categories = CustomMenuModel.toManyFromJson(demoJson);
    return putManyAsync(categories);
  }
}
